package com.zjeav.lingjiao.base.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zjeav.lingjiao.R;
import com.zjeav.lingjiao.base.baseBean.Book;
import com.zjeav.lingjiao.base.baseBean.UserBuyReCord;

import de.hdodenhof.circleimageview.CircleImageView;

public class BuyRecordAdapter extends BaseQuickAdapter<UserBuyReCord, BaseViewHolder> {
    private Context context;
    private int mType = 0;

    public BuyRecordAdapter(Context context) {
        super(R.layout.book_buy_record_item);
        this.context = context;
    }


    @Override
    protected void convert(com.chad.library.adapter.base.BaseViewHolder helper, UserBuyReCord item) {
        helper.setText(R.id.name_txt, item.getUsername());
        helper.setText(R.id.time_txt, item.getBuydate());

        CircleImageView imageView = helper.getView(R.id.header_img);
        Glide.with(context)
                .load(item.getUseravator())
                .error(R.mipmap.user_uesrinfo)
                .into(imageView);


    }
}